<template>
	<view>
		<scroll-view :scroll-y="modalName==null" class="page" :class="modalName!=null?'show':''">
			<cu-custom bgColor="bg-gradual-blue" :isBack="true">
				<block slot="content">合同详情</block>
			</cu-custom>
			
					<view style="padding-bottom: 50rpx;">
							<view class="flex flex-direction box">
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											合同编号
										</view>
										<view class="val">
											{{this.detailObj.ph | emptyStr }}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											政府编号
										</view>
										<view class="val">
											{{this.detailObj.zfbh | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											企业名称
										</view>
										<view class="val">
											{{this.detailObj.mc | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											签约人
										</view>
										<view class="val">
											{{this.detailObj.qyr | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											出租方
										</view>
										<view class="val">
											{{this.detailObj.czf | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											出租签约人
										</view>
										<view class="val">
											{{this.detailObj.czqy | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											土地年限
										</view>
										<view class="val">
											{{this.detailObj.tdnx | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											土地结束日期
										</view>
										<view class="val">
											{{this.detailObj.tdrq1 | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											起始日期
										</view>
										<view class="val">
											{{this.detailObj.tdnx | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											签约日期
										</view>
										<view class="val">
											{{this.detailObj.qyrq | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											产房年限
										</view>
										<view class="val">
											{{this.detailObj.cfnx | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											厂房起始日期
										</view>
										<view class="val">
											{{this.detailObj.ckrq | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											厂房结束日期
										</view>
										<view class="val">
											{{this.detailObj.ckrq1 | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											厂房签约日期
										</view>
										<view class="val">
											{{this.detailObj.cqrq | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											投产日期
										</view>
										<view class="val">
											{{this.detailObj.tcrq | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											土地面积
										</view>
										<view class="val">
											{{this.detailObj.tcrq | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											厂房面积
										</view>
										<view class="val">
											{{this.detailObj.cfmj | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											管理费年限
										</view>
										<view class="val">
											{{this.detailObj.zjnx | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											加福
										</view>
										<view class="val">
											{{this.detailObj.bl | emptyStr}}
										</view>
									</view>
									
									
									<view class="item flex flex-direction">
										<view class="label">
											土地证
										</view>
										<view class="val">
											{{this.detailObj.ttz | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											房产证
										</view>
										<view class="val">
											{{this.detailObj.fcz | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											制单人
										</view>
										<view class="val">
											{{this.detailObj.zdr | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											付款人
										</view>
										<view class="val">
											{{this.detailObj.fkr | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											投厂日期
										</view>
										<view class="val">
											{{this.detailObj.tbrq | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											运行状态
										</view>
										<view class="val">
											{{this.detailObj.yxzt | emptyStr}}
										</view>
									</view>
									<view class="item flex flex-direction">
										<view class="label">
											备注
										</view>
										<view class="val">
											{{this.detailObj.bz | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item flex flex-direction">
										<view class="label">
											合同文件名
										</view>
										<view class="val">
											{{this.detailObj.flname | emptyStr}}
										</view>
									</view>
								</view>
								<view class="row flex">
									<view class="item" style="width: 100%;">
										<view class="btn" @click="handleDetail(1)">
											土地厂房购买计划收款
										</view>
										<view class="btn" @click="handleDetail(2)">
											土地厂房购买实际收款
										</view>
										<view class="btn" @click="handleDetail(3)">
											厂房租金
										</view>
										<view class="btn" @click="handleDetail(4)">
											管理费设定
										</view>
									</view>
								</view>
								
							</view>
					</view>
				
			
		</scroll-view>
	</view>

</template>

<script>
	export default {
		components:{
		},
		data() {
			return {
				modalName: null,
				contractNumber: '',
				enterpriseName: '',
				refresherBool: false,
				pageNo : 1,
				pageSize : 5,
				listUrl:'/assets.leaseContract/dbHtb/list',
				list:[],
				total: '',
				detailObj : {}
			}
		},
		methods: {
			handleSearch(){
				this.pageNo = 1
				this.getList()
			},
			handleDetail(type){
				console.log(type)
				this.goPage('/pages/contractList/contractDetail' , {
					id:this.detailObj.ph,
					type
				})
			},
			handleRefresher(){
				this.refresherBool = true
				setTimeout(()=>{
					this.refresherBool = false
				},1000)
				this.handleSearch()
			},
			loadMore(){
				if(this.total == this.list.length) return this.setMessage('没有更多了')
				this.pageNo++
				this.getList()
			},
			getList(){
				if(this.pageNo==1) this.list = []
				
				this.$http.get(this.listUrl,{params:{
					column: 'createTime', 
					order: 'desc', 
					pageNo: this.pageNo, 
					pageSize:this.pageSize,
					ph: this.contractNumber,
					mc: this.enterpriseName,
					}}).then(res=>{
						if(res.data.success){
							this.list = this.list.concat(res.data.result.records)
							this.total = res.data.result.total
						}
				})
			}
		},
		onLoad(){
			this.detailObj = this.$Route.query.item
			console.log(this.detailObj);
		}
	}
</script>

<style lang="scss" scoped>
	.btn{
		margin: 20rpx 0;
		padding: 0 20rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #1890ff;
		border-radius: 8rpx;
		color: #fff;
		white-space: nowrap;
	}
	.searchBox{
		// height: calc( 15vh - 45px );
		display: flex;
		align-items: center;
		background-color: #fff;
		padding: 0 20rpx;
		border-bottom: 1px solid #f1f1f1;
		box-shadow: 0px 6rpx 12rpx rgba(0, 0, 0, 0.16);
		.inputBox{
			flex: 1;
			padding-right: 30rpx;
			.input{
				
			}
		}
		
	}
	.box{
		background-color: #fff;
		margin: 25rpx;
		border-radius: 8rpx;
		padding: 10rpx;
		.row{
			margin: 10rpx;
		}
	}
	.item{
		width: 50%;
		padding-right: 20rpx;
	}
	.label{
		color: #969696;
	}
	.val{
		color: #353535;
		font-size: 32rpx;
		word-wrap: break-word;
	}
</style>
